package cn.nfwx.tv.events;

import org.greenrobot.eventbus.EventBus;

import cn.nfwx.tv.util.LogUtil;

/**
 * Created by zhouzechao on 2017/12/12.
 */

public class Event {
    private static final String TAG = Event.class.getSimpleName();

    // 普通的事件触发
    public static final int EVENT_APPIONTMENT = 1;
    public static final int EVENT_APPIONTMENT_READY = 2;
    public static final int EVENT_LOGIN = 3;
    public static final int EVENT_LOGOUT = 4;
    public static final int EVENT_PULL_CHANGE = 5;

    public int mEvent;

    public Event(int event) {
        mEvent = event;
    }

    /**
     * 预约更新状态信息
     */
    public static void postAppiontmentEvent() {
        EventBus.getDefault().post(new Event(Event.EVENT_APPIONTMENT));
    }

    /**
     * 登录刷新event
     */
    public static void postLoginEvent() {
        LogUtil.d(TAG, "postLoginEvent");
        EventBus.getDefault().post(new Event(Event.EVENT_LOGIN));
    }

    /**
     * 登出刷新event
     */
    public static void postLogoutEvent() {
        EventBus.getDefault().post(new Event(Event.EVENT_LOGOUT));
    }

    /**
     * 推送设置
     */
    public static void postPullChangeEvent() {
        EventBus.getDefault().post(new Event(Event.EVENT_PULL_CHANGE));
    }
}
